package com.example.gokchinesefoodmapmcdev.test;

import com.example.gokchinesefoodmapmcdev.dao.GoodAttrKeyDAO;
import com.example.gokchinesefoodmapmcdev.entity.goods.GoodAttrKey;
import com.example.gokchinesefoodmapmcdev.entity.sms.SmsProperties;
import com.example.gokchinesefoodmapmcdev.entity.sys.SysUser;
import com.example.gokchinesefoodmapmcdev.util.MyTranslateTools;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Random;

@RunWith(SpringRunner.class)
@SpringBootTest
public class MyTest01 {

    @Autowired
    private GoodAttrKeyDAO goodAttrKeyDAO;


    @Test
    public void  test(){
        List<GoodAttrKey> goodAttrKeys = goodAttrKeyDAO.selectList(null);
        System.out.println(goodAttrKeys);
    }

    @Test
    public void test1(){
        SysUser sysUser = new SysUser();
        sysUser.setGmtCreate(new Date());
        Map<String, Object> map = MyTranslateTools.transEntityToMap(sysUser);
        System.out.println(map);

    }

    @Test
    public void test3(){
        Integer a = null;
        int b = 0;
        System.out.println(a + b);
    }

    @Autowired
    SmsProperties smsProperties;

    @Test
    public void test4(){
        System.out.println(smsProperties);
    }

    @Test
    public void test5(){
        System.out.println(new Random(10));
    }
}
